﻿/***********************************************************************************************
 * 
 * ProjectName: WMSSoft.Lib.WinKStart
 * 
 * Description: Contains the configuration for a action
 * 
 * Created:     07.09.2014
 * 
 * Author:      matthias wagler - matthias@WMSSoft.de
 * 
 * Copyright:   Copyright 2012 by WMSSoft.net
 * 
 * License:     GPLv3
 * 
 * History:     07.09.2014 - matthias wagler matthias@WMSSoft.de   -   Created
 * 
 **********************************************************************************************/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WMSSoft.Lib.Enums;
using WMSSoft.Lib.WinKStart.Abstract;

namespace WMSSoft.Lib.WinKStart.Model.MenuConfig
{
    /// <summary>
    /// Class Describe a Action for a Function
    /// </summary>
    [Serializable()]
    public class cWinKStartAction : CModelBase
    {
        private Dictionary<string, Trigger> m_Trigger = new Dictionary<string, Trigger>();
        private List<SourceElement> m_SourceElements = new List<SourceElement>();
        private eEventSourceType m_Type = eEventSourceType.ContextMenu;
        private string m_Name = "";
        private string m_EventSourceElement = "";
        private string m_Function = "";

        /// <summary>
        /// Describe the Events
        /// </summary>
        public Dictionary<string,Trigger> Triggers
        {
            get { return m_Trigger; }
            set 
            { 
                m_Trigger = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Describe the Event - Source: ContextMenu or GUI Control
        /// </summary>
        public eEventSourceType Type
        {
            get { return m_Type; }
            set 
            { 
                m_Type = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Contains the Name for this Action
        /// </summary>
        public string Name
        {
            get { return m_Name; }
            set 
            { 
                m_Name = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// 
        /// </summary>
        public List<SourceElement> SourceElements
        {
            get { return m_SourceElements; }
            set 
            { 
                m_SourceElements = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Contains the GUI Element to get Event from
        /// </summary>
        public string EventSourceElement
        {
            get { return m_EventSourceElement; }
            set 
            { 
                m_EventSourceElement = value;
                OnPropertyChanged();
            }
        }

        /// <summary>
        /// Copntains the name for the Code Procedure that is running if Action will raised
        /// </summary>
        public string Function
        {
            get { return m_Function; }
            set 
            { 
                m_Function = value;
                OnPropertyChanged();
            }
        }

    }
}
